<template>
    <div class="app-container">
        <ContractInfo :contract-info="detailInfo.contractInformation"></ContractInfo>
        <OutCarInfo :outbound-vehicle-condition="detailInfo.outboundVehicleCondition"></OutCarInfo>
        <CheckReturnCar ref="checkReturnCar" v-model="detailInfo"></CheckReturnCar>
    </div>
</template>

<script>
import OutCarInfo from "@/views/returnCar/components/OutCarInfo.vue";
import ContractInfo from "@/views/returnCar/components/ContractInfo.vue";
import CheckReturnCar from "@/views/returnCar/components/CheckReturnCar.vue";

export default {
    components: {CheckReturnCar, ContractInfo, OutCarInfo},
    props:{
        value: {
            default: {},
        },
        state: {
            default: "readonly",
        },
    },
    data() {
        return {
        }
    },
    computed:{
        detailInfo:{
            get(){
                return this.value;
            }
        }
    },
    methods: {
        // async  commit(){
        //   const validFlag = await this.valid()
        //     console.log('校验结果--', validFlag,  '当前数据----', this.detailInfo)
        // },
        valid() {
            return new Promise(async (resolve) => {
                let result = this.$refs.checkReturnCar.saveForm();
                resolve(result);
            });
        },
    },
    mounted() {
    },

}
</script>

<style lang="scss" scoped>
</style>
